Setting up CI CD for Admins
Documented below are the steps you will need to take on the Services VM to enable a new application to use the ABAIR CI/CD pipeline
1. Create Directory For Project
sudo mkdir /home/services/project-name
2. Add Deploy Script to Directory
- Replace the password
{see elsewhere}with the admin password you can find in ABAIR CI/CD.
deploy-project-name.sh
docker stop project-name
docker rm project-name
docker login 10.0.0.2:5000 -u admin -p {see elsewhere}
docker rmi 10.0.0.2:5000/project-name:main
docker pull 10.0.0.2:5000/project-name:main
docker run -t -d -p port:port --restart always --name project-name 10.0.0.2:5000/project-name:main
3. Generate SSH Keys
In order for the new GIthub Action to be able to SSH into the services VM it needs its own private key. This can be generated as follows:
sudo su services
ssh-keygen -t ed25519 -a 200 -f ~/.ssh/project-name_ed25519 -C "project-name Github Action"
cat ~/.ssh/project-name_ed25519.pub >> ~/.ssh/authorized_keys
Send private key to developer.